import request from "@/api/request.js";

// 新建专辑
export function createNewAlbum(name, cover, style, des, account) {
    const formData = {
        "name": name,
        "cover":　cover,
        "style": style,
        "des": des,
        "account": account
    }

    return request({
        url: '/music/album/add',
        method: 'post',
        data: formData
    })
}
export function deleteDraftMusic(id) {
    return request({
        url: "/admin/draft/del_music/" + id ,
        method: 'delete'
    })

}
// 拉取草稿箱的数据
export function listDrafts(account) {
    return request({
        url: "/admin/draft/apply_recover?account=" + account ,
        method: 'get'
    })

}
// 拉取用户的专辑
export function listAlbums(account) {
    return request({
        url: "/music/album/getAlbums?account=" + account ,
        method: 'get'
    })

}
// 拉取用户的专辑
export function listStyles() {
    return request({
        url: "/music/album/styles/list" ,
        method: 'get'
    })

}

// 申请音乐审核
export function applyMusic(albumId, musicList, account) {
    const formData = {
        "albumId": albumId,
        "musicList": musicList,
        "account": account
    }
    return request({
        url: "/admin/apply/music" ,
        method: 'post',
        data: formData
    })

}
// 申请音乐人审核
export function applyMusician(name, type, area, brief, avatar, account) {
    const formData = {
        name: name,
        type: type,
        area: area,
        brief: brief,
        avatar: avatar,
        account: account
    }



    return request({
        url: "/admin/apply/musician" ,
        method: 'post',
        data: formData
    })

}
